Skip to content

Feat DocumentsDB#2825

Open
ItzNotABug wants to merge 133 commits intomainfrom
feat-documentsdb
Open

Feat DocumentsDB#2825
ItzNotABug wants to merge 133 commits intomainfrom
feat-documentsdb

Conversation

@ItzNotABug
Copy link
Contributor

@ItzNotABug ItzNotABug commented Feb 3, 2026

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • New Features

    • Full Create Database wizard with type & backup options.
    • Rich JSON editor with linting, highlighting, hover, read-only protection, duplicate-key checks and save/undo UI.
    • Record activity and permissions panels; display-name editor; inline suggestions and sample-data generation.
  • Improvements

    • Schema-aware filters, fuzzy key detection, enhanced spreadsheet/NoSQL views and responsive layouts.
    • Unsaved-changes guard, improved progress handling, and improved CSV/JSON import UX.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/+layout.svelte:
- Around line 74-84: Replace hardcoded "table"/"table-" strings and static
labels with the existing terminology object: use terminology-provided labels
(e.g., terminology.labels.createEntity / terminology.labels.goToEntities /
terminology.labels.findEntities) instead of "Create table", "Go to tables",
"Find tables", and replace URL checks like page.url.pathname.includes('table-')
with a dynamic check using the terminology value (e.g.,
page.url.pathname.includes(`${terminology.entity}-`) or whichever terminology
field gives the entity slug) so the disabled logic and key hints use terminology
consistently; update all occurrences referenced in this diff (the callback that
sets $showCreateEntity and goto, the keys assignment, and the disabled
conditions at the shown lines and the other instances you noted) to reference
terminology and databaseId/project/base/page symbols already in scope.

In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/(components)/editor/view.svelte:
- Around line 930-943: The saved selection positions
(currentSelection.anchor/head) from the old document may be out-of-range after
replacing content, causing CodeMirror errors; in the block that builds the new
content (serializeData(updatedData)) and calls editorView.dispatch, remove the
explicit selection field so CodeMirror can automatically map the cursor through
the change instead of applying stale positions — update the dispatch call in the
editorView handling (where currentSelection/currentContent are captured and
editorView.dispatch is invoked) to only provide changes: { from: 0, to:
currentContent.length, insert: newContent } and omit selection.

In
`@src/routes/`(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/spreadsheet.svelte:
- Around line 280-329: hadErrors is unused dead code in handleDelete — remove it
and its conditional guard instead of keeping a flag that's never set; delete the
hadErrors declaration and the surrounding if (!hadErrors) { ... } block (which
wraps addNotification success), leaving the success notification in the try path
(so success is shown only when no exception occurs), and keep the existing catch
which already shows errors and short-circuits; update references to hadErrors
(if any) accordingly.
🧹 Nitpick comments (2)
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/(components)/editor/extensions/highlighting.ts (1)

117-167: createSystemFieldStylePlugin scans all lines on every doc change — consider viewport scoping for large documents.

Unlike createNestedKeyPlugin which only processes visible ranges, this plugin iterates every line in the document on each change. For typical document sizes this is fine, but if the editor could host very large JSON documents, consider scoping to view.visibleRanges the same way.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/(components)/editor/view.svelte (1)

600-665: SvelteMap used in non-reactive contexts — use plain Map instead.

checkSystemFieldsMatch (line 602) and applySystemFieldsPatch (line 690) use SvelteMap, but these are local helper functions where Svelte reactivity tracking adds overhead for no benefit. A plain Map is more appropriate.

♻️ Suggested fix
-        const foundValues = new SvelteMap<string, string>();
+        const foundValues = new Map<string, string>();
-        const hits = new SvelteMap<string, Hit>();
+        const hits = new Map<string, Hit>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants